home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
load_scenario.gl.p
< prev
next >
Wrap
Text File
|
2003-01-28
|
9KB
|
294 lines
{
ActiveWhileHidden = TRUE;
Hidden = TRUE;
ChildID = {
GuiAnimation("plate") {
AnimationID = "anim/guage_gui/guage_window.pcx";
X = 0;
Y = 0;
Width = 500;
Height = 430;
},
GuiAnimation("guages") {
AnimationID = "anim/guage_gui/window/guagy.anm";
X = 0;
Y = 0;
Width = 340;
Height = 360;
},
GuiAnimation("num_player_label") {
X = 120;
Y = 70;
HorizontalAlign=LEFT;
Width = 10;
Height = 10;
FontID = "font/square_black_on_gray_9.tf";
TextID = Mangle(127/*"Number of Players:"*/);
},
GuiButtonGroup("1Player") {
X = 180;
Y = 110;
RadioGroupID = 1;
ScriptID = Script {
@show {
ResParseEvent(SELF,"@activate");
ResPropSetResID(SELF, "ActiveButtonID", GuiChildByName(SELF, "radio_button_selected"));
ResPropSetResID(GuiSiblingByName("2Player"), "ActiveButtonID", GuiSiblingByName("2Player/radio_button_unselected"));
}
@activate {
ResPropSetInt(ResByName("Game"), "game_num_players", 1 );
ResPropSetInt(GuiSiblingByName("player2_name"),"Hidden",TRUE);
}
};
ChildID = {
GuiButton("radio_button_unselected") {
StyleID = "gui/bs/radiounsel.gbs";
VerticalAlign = ABOVE;
TextDownOffsetX = 0;
TextDownOffsetY = 0;
VerticalPadding = 4;
TextID = Mangle(128/*"1"*/);
FontID = "font/square_black_on_gray_9.tf";
},
GuiButton("radio_button_selected") {
StyleID = "gui/bs/radiosel.gbs";
VerticalAlign = ABOVE;
TextDownOffsetX = 0;
TextDownOffsetY = 0;
VerticalPadding = 4;
TextID = Mangle(129/*"1"*/);
FontID = "font/square_black_on_gray_9.tf";
}
};
},
GuiButtonGroup("2Player") {
X = 210;
Y = 110;
RadioGroupID = 1;
ScriptID = Script {
@activate {
ResPropSetInt(ResByName("Game"), "game_num_players", 2 );
ResPropSetInt(GuiSiblingByName("player2_name"),"Hidden",FALSE);
}
};
ChildID = {
GuiButton("radio_button_unselected") {
StyleID = "gui/bs/radiounsel.gbs";
VerticalAlign = ABOVE;
TextDownOffsetX = 0;
TextDownOffsetY = 0;
VerticalPadding = 4;
TextID = Mangle(130/*"2"*/);
FontID = "font/square_black_on_gray_9.tf";
},
GuiButton("radio_button_selected") {
StyleID = "gui/bs/radiosel.gbs";
VerticalAlign = ABOVE;
TextDownOffsetX = 0;
TextDownOffsetY = 0;
VerticalPadding = 4;
TextID = Mangle(131/*"2"*/);
FontID = "font/square_black_on_gray_9.tf";
}
};
},
GuiTextInput("player1_name") {
AnimationID = "gui/square/window/window_text_entry.pcx";
X = 180;
Y = 140;
Width = 120;
Height = 22;
InsertCursorID = "gui/dash/tab/insert_cursor.pcx";
OverwriteCursorID = "gui/dash/tab/overwrite_cursor.pcx";
TextX = -50;
FontID = "font/square_black_on_gray_9.tf";
InputFontID = "font/verdana_9_black.tf";
TextID = Mangle(132/*"Name:"*/);
InputText = 32:"player 1";
ScriptID = Script {
@mousedown {
if (StrExact(ResPropGetStr(SELF,"InputText"),"player 1")) {
ResPropSetStr(SELF,"InputText","");
}
}
};
},
GuiTextInput("player2_name") {
AnimationID = "gui/square/window/window_text_entry.pcx";
X = 180;
Y = 180;
InsertCursorID = "gui/dash/tab/insert_cursor.pcx";
OverwriteCursorID = "gui/dash/tab/overwrite_cursor.pcx";
Width = 120;
Height = 22;
TextX = -50;
FontID = "font/square_black_on_gray_9.tf";
TextID = Mangle(133/*"Name:"*/);
InputText = 32:"player 2";
InputFontID = "font/verdana_9_black.tf";
ScriptID = Script {
@mousedown {
if (StrExact(ResPropGetStr(SELF,"InputText"),"player 2")) {
ResPropSetStr(SELF,"InputText","");
}
}
};
},
GuiAnimation("scenario_label") {
X = 120;
Y = 220;
HorizontalAlign=LEFT;
Width = 10;
Height = 10;
FontID = "font/square_black_on_gray_9.tf";
TextID = Mangle(134/*"Scenario:"*/);
},
GuiListbox("scenario_listbox") {
X = 130;
Y = 235;
Height = 100;
Width = 250;
ListHilightedColor = #7FAFFF;
ScriptID = Script {
@show {
GuiListboxClear(SELF);
GuiListboxLoadDirFiltered(SELF, CVarGetStr("SavedScenarioDir"), "scn");
GuiListboxSetSelected(SELF, StrListAt(ResPropGetResID(SELF, "StrListID"), 0));
}
};
StrListID = StrList {
Indexed = TRUE;
Size = 10240;
};
ChildID = {
GuiScrollBar ("sb") {
Kind = VERTICAL;
ChildID = {
GuiButton("thumb") {
StyleID = "gui/square/scrollbar/sb_thumb.gbs";
},
GuiButton("dec") {
StyleID = "gui/square/scrollbar/sb_uarrow.gbs";
},
GuiButton("inc") {
StyleID = "gui/square/scrollbar/sb_darrow.gbs";
}
};
}
};
},
GuiButton("main_menu") {
X = 100;
Y = 340;
TextID = Mangle(135/*"Main Menu"*/);
StyleID = "gui/bs/square.gbs";
FontID = "font/square_black_on_gray_9.tf";
Width = 160;
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
resid mc;
mc = ResByName("splash_screen.gl/menu_controller");
ResPropSetResID(mc,"panel_to_display", ResByName("main_menu.gl"));
}
};
},
GuiButton("load_scenario") {
X = 260;
Y = 340;
TextID = Mangle(136/*"Load Scenario"*/);
StyleID = "gui/bs/square.gbs";
FontID = "font/square_black_on_gray_9.tf";
Width = 160;
AutoSize = HEIGHT;
ScriptID = Script {
@activate {
str scenario_to_load;
str tmp;
resid com_id;
int i;
int j;
resid player_id;
resid player_scenario_id;
scenario_to_load = GuiListboxGetSelected(GuiSiblingByName("scenario_listbox"));
if (StrExact(scenario_to_load, "")) {
/* TODO: report error */
stop;
} else {
/* set the current player to player 1 */
ResPropSetResID(ResByName("Game"), "game_cur_player", ResByName("Player1"));
/* set the players names into the player objects */
ResPropSetStr(ResByName("Player1"), "player_name", ResPropGetStr(GuiSiblingByName("player1_name"), "InputText") );
ResPropSetStr(ResByName("Player2"), "player_name", ResPropGetStr(GuiSiblingByName("player2_name"), "InputText") );
/* load scenario */
ResLoadAs("ScenarioGroup", "ScenarioGroup", StrFormatStr("%s%s",CVarGetStr("SavedScenarioDir"), scenario_to_load));
i = 0;
while (i<2) {
if (i==0) {
player_id = ResByName("Player1");
i=1;
} else {
player_id = ResByname("Player2");
i=2;
}
player_scenario_id = ResPropGetResID(player_id, "scenario_id");
ResPropSetInt(player_id, "commodity_number_of", ResPropGetInt(player_scenario_id, "scenario_commodity_number_of"));
com_id = ResPropGetResID(player_id, "commodity_bonus");
ResPropSetStr(com_id, "commodity_name", ResPropGetStr(player_scenario_id, "scenario_commodity_bonus"));
ResPropSetInt(com_id, "commodity_state", 0);
j=1;
while(j<=12) {
tmp = StrFormatStr("commodity_%d", j);
com_id = ResPropGetResID(player_id, tmp);
tmp = StrFormatStr("scenario_commodity_name_%d", j);
ResPropSetStr(com_id, "commodity_name", ResPropGetStr(player_scenario_id, tmp));
ResPropSetInt(com_id, "commodity_state", 0);
j+=1;
}
}
/* init a game */
ResParseEvent(ResByName("common/init_game.c4"),"@INIT_GAME");
release("floor");
mark("floor");
/* load the loading screen */
ResByName("loader.gl");
/* load the dispatch screen */
/* ResByName("laptop.gl"); done by loader now */
}
}
};
}
};
}